package com.tc.service.impl;

import com.tc.domain.dataobject.Order;
import com.tc.domain.mapper.OrderMapper;
import com.tc.model.dto.UserAndAmountInfoDTO;
import com.tc.service.OrderService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OrderServiceImpl implements OrderService {


    @Resource
    private OrderMapper orderMapper;
    @Override
    public List<Order> findAllPaidOrdersDESC() {
        return null;
    }

    @Override
    public List<UserAndAmountInfoDTO> findAllOrdersAndUserId() {
        List<UserAndAmountInfoDTO> amountByUserId = orderMapper.findAmountByUserId();
        return amountByUserId;
    }

    @Override
    public List<Order> top3ByUserId() {
        List<Order> top3ByUserId = orderMapper.findTop3ByUserId();
        return top3ByUserId;
    }

    @Override
    public Long sum7days() {
        Long SevendaysOrderSum = orderMapper.find7daysOrderSum();
        return SevendaysOrderSum;
    }

    @Override
    public List<Order> top5ByAmount() {
        List<Order> top5AmountOrders = orderMapper.findTop5AmountOrders();
        return top5AmountOrders;
    }
}
